home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000134_icon-group-sender _Wed Jun 12 13:39:41 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Wed, 12 Jun 1996 16:25:00 MST
To: icon-group@cs.arizona.edu
Date: Wed, 12 Jun 1996 13:39:41 -0400
From: Farshad Nayeri <farshad@cmass.com>
Message-Id: <31BF00DD.5535@cmass.com>
Organization: Critical Mass, Inc.
Sender: icon-group-request@cs.arizona.edu
References: <4pa3hq$lpc@labrador.cs.purdue.edu>, <4pd03h$g3o@lectura.CS.Arizona.EDU>, <4pigls$1kq@beatty.slip.netcom.com>
Subject: Re: m3 should have SWAP(a,b)
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
Derek Lee Beatty wrote:
>
> dave@CS.Arizona.EDU (Dave Schaumann) wrote:
> >For my part, the only time I've found 'swap' to be a useful
> >operation is when I am writing sort algorithm (or sort-related algorithms,
> >like heap manipulation). Since (in my experience, anyway) this is not a
> >frequent occurrance, it doesn't seem like the best idea in the world to
> >include 'swap' as part of any language's basic repetoir of operations.
> >
> >Perhaps others have found a more extensive use for swapping?
> >
>
> I've found SWAP useful in VLSI circuit analysis. I suspect other domains
> where the natural representation is nearly a graph might be similar.
>
> I'd expect that once you decide to include SWAP, generalizing to multiple
> assignment might be worthwhile. Perhaps after the right-hand sides are
> evaluated, all the left-hand sides could be updated atomically? (I'm just
> guessing here; perhaps that would complicate the runtime unnecessarily.)
I would take Derek's point one step further:
I am yet to see a concise proposal that clearly describes the semantics of the
SWAP or multiple assignment operator (especially in presense of threads.) Sure,
it's not so hard to think about the syntax for it, but that's the least of the
problem.
I'll even be satisfied with a syntactic mapping, e.g., the way the Modula-3
language specification maps LOCK END to TRY FINALLY END. So far, everyone
seems to have a different semantic in mind.
In fact, I propose that future syntax "wish list" proposals should at least
include a syntactic mapping. Of course, they should also mention which
features they are willing to cut in order to include the new proposal! (Or
God forbid, state that they want to go beyond the 50 pages?!)
-- Farshad